class User < ActiveRecord::Base

	validates :first_name, :presence => true,
												 :length => 2..20
 	validates :last_name, :presence => true,
												:length => 2..20
 	validates :email_address, :presence =>true
 	validates_format_of :email_address, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i

	has_secure_password


	before_save { |user| user.email_address = user.email_address.downcase }

end
